﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<hercules.Models.VendaModel>>" %>


<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Vendas
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Vendas</h2>

<p>
    <%: Html.ActionLink("Criar Nova Venda", "Create") %>
</p>
<table>
    <thead>
    <tr>
        <th>
            Funcionário
        </th>
        <th>
            Cliente
        </th>
        <th>
            Modelo
        </th>
        <th>
            Data Emissao
        </th>
        <th>
            Data Saida
        </th>
        <th>
            Natureza CFOP
        </th>
        <th>
            Valor Total
        </th>
        <th>
            Desconto
        </th>
        <th>
            Quantidade
        </th>
        <th>
            Valor Unitário
        </th>
        <th>
            Valor Total Produto
        </th>
        <th>
            Status Venda
        </th>
        <th></th>
    </tr>
    </thead>
    <tbody>
<% foreach (var item in Model) { %>
    <tr>
        <td>
            <%: Html.DisplayFor(modelItem => item.Pessoa1.cpf) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Pessoa.cpf) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Modelo) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.DataEmissao) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.DataSaida) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.NaturezaCFOP) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.ValorTotal) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Desconto) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Quantidade) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.ValorUnitario) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.ValorTotalProduto) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.StatusVenda) %>
        </td>
        <td>
            <%: Html.ActionLink("Editar", "Edit", new { id=item.NumeroNota }) %> |
            <%: Html.ActionLink("Detalhes", "Details", new { id=item.NumeroNota }) %> |
            <%: Html.ActionLink("Deletar", "Delete", new { id=item.NumeroNota }) %> |
            <%: Html.ActionLink("Itens", "SearchIndex", "ProdutoVenda", new { numeroNota=item.NumeroNota },null)%>
            <a href="../ProdutoVenda/Delete.aspx">../ProdutoVenda/Delete.aspx</a>
            
        </td>
    </tr>
<% } %>
</tbody>
</table>

</asp:Content>
